<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <title>系统模板数据--详情</title>
    <#include "/view/head.html"/>
    <script type="text/javascript" src="${base}/jstool/bootstrap-switch/bootstrap-switch.min.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-fileinput/js/fileinput.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-fileinput/js/locals/zh.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-switch/bootstrap-switch.min.css" />
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-fileinput/css/fileinput.min.css" />
    <style type="text/css">
        .list-path{
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;

        }
        .table-class{
            width:90%;
            text-align: center;
            border:1px solid #afd9ee;
            margin:0 auto;
            margin-top: 50px;
        }
        table th{
            width:20%;
            background-color: #d9edf7;
            text-align: right;
        }
        table td{
            width:20%;
            text-align: left;
        }

    </style>
    <script type="text/javascript">
    $(function () {
        $('.label-write').css('display','none');
        $('.btn-save').css('display','none');
        $('.btn-cansel').css('display','none');
        $('#picPath').fileinput({
            language: 'zh', //设置语言
            allowedFileExtensions : ['jpg', 'png','gif'],//接收的文件后缀
            showUpload: false, //是否显示上传按钮
            showCaption: false,//是否显示标题
            browseClass: "btn btn-primary", //按钮样式
            previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
        });
        $('[name="display"]').bootstrapSwitch({
            onText:"显示",
            offText:"隐藏",
            onColor:"success",
            offColor:"info",
            size:"small",
            onSwitchChange:function(event,state){
                if(state==true){
                    $(this).val("1");
                }else{
                    $(this).val("0");
                }
            }
        });
        $('[name="usetemplate"]').bootstrapSwitch({
            onText:"是",
            offText:"否",
            onColor:"success",
            offColor:"info",
            size:"small",
            onSwitchChange:function(event,state){
                if(state==true){
                    $(this).val("1");
                }else{
                    $(this).val("0");
                }
            }
        });
    });


    </script>
</head>
<body>

<div class="list-path" > <span style="margin-left: 50px;"> <a href="${base}/listDatasu"><span class="glyphicon glyphicon-home"></span> 系统模板数据</a>  /详情</span>
    <div style="float:right;margin-right: 40px;"><a class="btn btn-info" href="${base}/listDatasu">返回上一级</a></div>

    </div>
</div>


<div class="table-class">
    <#if msg??>
        <div class="alert alert-error" style="background-color: #f2dede;color: #a94442;">
            <a class="close" data-dismiss="alert">×</a>
            <strong>错误!</strong>${msg!}
        </div>
    </#if>
    <form id="form1" action="${base}/updateOrAdd" method="post" enctype="multipart/form-data">
    <table class="table table-bordered">
        <tr>
            <th colspan="4" style="text-align: center">系统模板</th>
        </tr>
        <tr>
            <th>名字</th>
            <td>
            <input type="hidden" name="dataresourceId" placeholder="名字" value="${czjdataresource.dataresourceId!}"/>
            <span class="label-view">${czjdataresource.name!}</span>
               <span class="label-write"><input type="text" class="form-control" name="name" placeholder="名字" value="${czjdataresource.name!}"/> </span>
            </td>
            <th>值</th>
            <td>
               <span class="label-view">${czjdataresource.value!}</span>
               <span class="label-write"><input type="text" class="form-control" name="value" placeholder="值" value="${czjdataresource.value!}"/> </span>
            </td>
        </tr>
        <tr>
            <th>标题</th>
            <td>
             <span class="label-view">${czjdataresource.title!}</span>
               <span class="label-write"><input type="text" class="form-control" name="title" placeholder="标题" value="${czjdataresource.title!}"/> </span>
            </td>
            <th>备注</th>
            <td>
           
            <span class="label-view"> ${czjdataresource.codename!}</span>
               <span class="label-write"><input type="text" class="form-control" name="codename" placeholder=备注" value=" ${czjdataresource.codename!}"/> </span>
            </td>

        </tr>
        <tr>
            <td colspan="4" width="100%" style="text-align: center;">
                <input type="button" class="btn btn-success isuse-btn btn-update" onclick="update();" value="修改"/>
                <input type="button" class="btn btn-success isuse-btn btn-save" onclick="save();" value="保存"/>
                <input type="button" class="btn btn-danger isuse-btn btn-cansel" onclick="cansel();" value="取消"/>
            </td>

        </tr>
    </table>
    </form>
</div>

<script type="text/javascript">
    function update(){
        $('.label-view').css('display','none');
        $('.label-write').css('display','');
        $('.btn-update').css('display','none');
        $('.btn-cansel').css('display','');
        $('.btn-save').css('display','');
    }
    function cansel(){
        $('.label-view').css('display','');
        $('.label-write').css('display','none');
        $('.btn-cansel').css('display','none');
        $('.btn-update').css('display','')
        $('.btn-save').css('display','none')
    }
    function save(){
//        $('.btn-save').attr('disabled',"disabled");
//        location.href="${base}/recommendpic/save.do";
        console.log($("input[name='display']").val());
        console.log($("input[name='usetemplate']").val());
        $('#form1').submit();
    }
</script>

</body>
</html>